import request from 'umi-request';
import defaultSettings from '../../../../config/defaultSettings';

export async function queryRule(params) {
  return request(`${defaultSettings.restAPI}/exporter?storage_type=ecs`, {
    params,
  });
}
export async function removeRule(params) {
  return request(`${defaultSettings.restAPI}/exporter/` + params['id'], {
    method: 'DELETE',
    data: { ...params, method: 'delete' },
  });
}
export async function addRule(params) {
  params['storage_type'] = 'ecs'
  return request(`${defaultSettings.restAPI}/exporter`, {
    method: 'POST',
    data: { ...params, method: 'post' },
  });
}
export async function updateRule(params) {
  return request(`${defaultSettings.restAPI}/exporter/` + params['id'], {
    method: 'PUT',
    data: { ...params, method: 'update' },
  });
}
